/**
 * 
 */
package com.vision.core.sv.security;

import org.springframework.security.authentication.encoding.MessageDigestPasswordEncoder;


/**
 * Utility class for encrypting, decrypting, and encoding data.
 * 
 * @author Mark
 *
 */
public class Encrypt {

	/**
	 * Salt used in encoding. WARNING: Do not modify this value!
	 */
	private static final String SALT = "-j4393r!3c0u!7r3-";
	
	private static final MessageDigestPasswordEncoder encoder = new MessageDigestPasswordEncoder("MD5", true);
	
	/**
	 * Encodes the value into a hash.
	 * 
	 * @param value
	 * @return
	 */
	public static String encode(String value) {
		return encoder.encodePassword(value, SALT);
	}

}
